import 'package:event_bus/event_bus.dart';
import 'package:flutterapp/Base/methodChannel/MethodChannelManager.dart';
import 'package:flutterapp/Base/net/HttpManager.dart';
import 'package:flutterapp/Base/redux/reduxConfig.dart';
import 'package:redux/redux.dart';
import 'package:shared_preferences/shared_preferences.dart';



EventBus myEventBus = EventBus();
MethodChannelManager myMethodChannelManager=MethodChannelManager.getInstance();
HttpManager myHttp = new HttpManager();
AppState appState=AppState.getInstance();
Store<AppState> appStore = new Store<AppState>(reducer, initialState: appState);

enum PUBLISHING_ENVIRONMENT { DEV, TEST, PROD }
//   TODO 修改发布环境
var ENV = PUBLISHING_ENVIRONMENT.DEV;

class InitConfig {
  static String BASE_API_HOST = "";
//  todo baseURL 发布环境
  static const String _DEV_API_HOST = "";
  static const String _TEST_API_HOST = "";
  static const String _PROD_API_HOST = "";
  static SharedPreferences SPrefs;

  static Future initApp() async {
    SPrefs = await SharedPreferences.getInstance();
    switch (ENV) {
      case PUBLISHING_ENVIRONMENT.DEV:
        BASE_API_HOST = _DEV_API_HOST;
        break;
      case PUBLISHING_ENVIRONMENT.TEST:
        BASE_API_HOST = _TEST_API_HOST;
        break;
      case PUBLISHING_ENVIRONMENT.PROD:
        BASE_API_HOST = _PROD_API_HOST;
        break;
    }
  }
}
